package com.zelma.agent.controller;

import java.io.IOException;
import java.text.ParseException;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;


import com.zelma.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.zelma.agent.entity.CircleEntity;
import com.zelma.agent.service.CircleService;




/**
 * 
 *
 * @author zelma
 * @email 1239115389@qq.com
 * @date 2022-01-06 16:48:57
 */
@RestController
@RequestMapping("agent/circle")
public class CircleController {

    @Autowired
    private CircleService circleService;

    //楼市圈信息同步ES接口
    @PostMapping("/eslist")
    public void eslist() throws IOException {

        circleService.eslist();
    }

    //楼市圈查询接口
    @GetMapping("/findCircleInfo")
    public R findCircleInfo(@RequestParam(value = "agentName",defaultValue = "") String agentName,
                            @RequestParam(value = "circleContent",defaultValue = "") String circleContent,
                            @RequestParam(value = "circleCreatedate",defaultValue = "") String circleCreatedate) throws IOException, ParseException {

        List <CircleEntity> list = circleService.findCircleInfo(agentName, circleContent, circleCreatedate);

        return R.ok().put("list",list);

    }

}
